---
sidebar_label: hasura init
sidebar_position: 11
description: Initialize a new Hasura GraphQL Engine project using the Hasura CLI
keywords:
  - hasura
  - docs
  - CLI
  - hasura init
---

# Hasura CLI: hasura init

Initialize a new Hasura GraphQL Engine project.

## Synopsis

This is generally the first command that you would run in a new project. It creates a directory with the necessary files and directories to configure an instance of the Hasura GraphQL Engine. You can pass various flags to customize the behavior of the command and pre-configure environment variables.
		
Further reading:
- https://hasura.io/docs/latest/migrations-metadata-seeds/migrations-metadata-setup/


```bash
hasura init [directory-name] [flags]
```

## Examples

```bash
# Create a directory to store migrations
hasura init [directory-name]

# Now, edit <my-directory>/config.yaml to add endpoint and admin secret

# Create a directory with endpoint and admin secret configured:
hasura init <my-project> --endpoint https://my-graphql-engine.com --admin-secret adminsecretkey

# Create a Hasura Project in the current working directory
hasura init .

# See https://hasura.io/docs/latest/graphql/core/migrations/index.html for more details
```

## Options

```sass
    --admin-secret string   admin secret for Hasura GraphQL Engine
    --endpoint string       http(s) endpoint for Hasura GraphQL Engine
-h, --help                  help for init
    --version int           config version to be used (default 3)
```

## Options inherited from parent commands

```sass
--envfile string      .env filename to load ENV vars from (default ".env")
--log-level string    log level (DEBUG, INFO, WARN, ERROR, FATAL) (default "INFO")
--no-color            do not colorize output (default: false)
--project string      directory where commands are executed (default: current dir)
--skip-update-check   skip automatic update check on command execution
```

## SEE ALSO

- [hasura](/hasura-cli/commands/hasura.mdx) - Hasura GraphQL Engine command line tool

_Auto generated by spf13/cobra_
